home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.001 / crossfir~ / eutl / chain-hash / test1.c < prev   
C/C++ Source or Header  |  1994-09-19  |  482b  |  25 lines

  1. #include <stdio.h>
  2. #include <chain-hash.h>
  3. #include <xfile.h>
  4.  
  5. #define DICT "/usr/dict/words"
  6.  
  7. int main(int argc,char *argv[])
  8. {
  9.   FILE *dict;
  10.   char buf[200],*check;
  11.   HashTable tbl;
  12.  
  13.   dict = xfopen(DICT,"r");
  14.   tbl = CreateHashTable(-20000,NULL);
  15.   while(fgets(buf,200,dict)!=NULL) {
  16.     SHashInsert(tbl,buf,buf,strlen(buf)+1);
  17.     check = SHashLookup(tbl,buf);
  18.     if (strcmp(check,buf)) {
  19.       fprintf(stderr,"Inconsistancy on %s",buf);
  20.       abort();
  21.     }
  22.   }
  23.   return 0;
  24. }
  25.